//
//  GWChannelCell.m
//  GiftWanted
//
//  Created by lanou on 15/11/11.
//  Copyright © 2015年 陈文杰. All rights reserved.
//

#import "GWChannelCell.h"
#import "UIImageView+WebCache.h"
#define x (SCREEN_WIDTH-50)/4

@implementation GWChannelCell
-(instancetype)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    if (self) {
        _image = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, x, x)];
        _title = [[UILabel alloc] initWithFrame:CGRectMake(0, x, x, 20)];
        _title.textAlignment = NSTextAlignmentCenter;
        _title.font = [UIFont systemFontOfSize:12];
        [self.contentView addSubview:_image];
        [self.contentView addSubview:_title];
    }
    return self;
}

- (void)setConfigureModel:(GWChannelsModel *)configureModel {
    
    _configureModel = configureModel;
    [_image sd_setImageWithURL:[NSURL URLWithString:configureModel.icon_url]];
    _title.text = configureModel.name;
}

@end
